<extend name="Public/base" />

<block name="style" >
    <style>
        .user_table{
            border: 1px solid #ddd;
            width: 180px;
        }
        .user_table tr{
            border: 1px solid #dddddd;
            height: 30px;
        }
        .user_table td{
            border: 1px solid #dddddd;
            width: 90px;
            text-align: center;
        }
    </style>
</block>

<block name="body">
    <!-- 弹窗插件 -->
    <include file="Public:artdialog" />
    <!-- 表单验证插件 -->
    <include file="Public:validform" />
        <input type="hidden" name="id" value="{$entity['id']}">
        <input type="hidden" name="is_add" value="{$is_add}">

        <div class="row">
            <div class="col-md-12">
                <div class="block-web">
                    <div class="header">
                        <h3 class="content-header">发票验证</h3>
                    </div>
                    <div class="porlets-content">
               <table class="table table-striped goods_list_table   table-bordered">
                <thead>
                    <tr>
                        <th class="opth100">供应商联系人</th>
                        <th class="opth100">采购单名称</th>
                        <th class="opth100">商品名</th>
                        <th class="opth100">报价数量</th>
                        <th class="opth100">实际采用数量</th>
                        <th class="opth100">报价价格</th>
                        <th class="opth100">送货时间</th>
                        <th class="opth70">是否批次送货</th>
                        <th class="opth70">是否有效</th>
                        <th class="opth70">交易状态</th>
                        <th class="opth70">管理员操作</th>
                        <th class="opth70">操作时间</th>
                    </tr>
                </thead>
                <tbody id="tbodylist">
                    <volist name="list" id="g">
                        <tr>
                            <td>{$g['linkname']}</td>
                            <td>{$g['purchaseame']}</td>
                            <td>{$g['goodsname']}</td>
                            <td>{$g['offer_number']}</td>
                            <td>{$g['actual_number']}</td>
                            <td>{$g['offer_price']}</td>
                            <td>{$g['sendtime']}</td>
                            <td>{$g['isbatch']==1?'是':'否'}</td>
                            <td>{$g['iscomfirm']==1?'是':'否'}</td>
                            <td>{$arr[$g['check']]}</td>
                            <td>{$g['user_name']}</td>
                            <td>{$g['createtime']}</td>
                        </tr>
                    </volist>

                </tbody>
            </table>
                <div class="form-group">

                            <label class="col-sm control-label"><font class="red">*</font>发票</label>
                            <volist name="invoiceurl_arr" id="url">
                            <div class="col-sm">
                                <img src="/Images/{$url}" >
                            </div>
                            </volist>
                        </div>
                        <div class="form-group">
                            <label class="col-smcontrol-label"></label>
                            <a class="btn btn-primary btn-success bt_submit" onclick="verification('{$offerid}',0)"  >验证失败</a>
                            <a class="btn btn-primary btn-success bt_submit" onclick="verification('{$offerid}',1)" >验证成功</a>
                        </div>
                    </div><!--/porlets-content-->
                </div><!--/block-web-->
            </div>

        </div>



</block>
<block name="script">
    <script>

   var url ="{:U('/Offer/invoice')}";
        function verification(offerid,state) {
            $.ajax({
                'url': url,
                'data': {offerid:offerid,state:state},
                'dataType': 'json',
                'type': 'get',
                success: function (data) {
              
                        art.dialog({title:'温馨提示',content: data.msg, ok: function () {this.close();return false;},okval:'确定'});
                          setTimeout(function(){
                             var win=    art.dialog.opener;
                                        win._reload_currentpage_datalist('load_tb_div');
                                        art.dialog.close();
                             },1000); 
                        _load_html_byurl("{:U('offerList')}", "load_tb_div");
                }, error: function () {
                    

                }, complete: function () {

                }
            });


        }



    </script>

</block>
